package com.yyg.wiki.exception;

/**
 *
 * 功能描述: 自定义异常，针对异常传递参数，进行一个异常检测。是一些自己确切的异常，自己定义的
 *
 * @param:
 * @return: 
 * @auther: 17878
 * @date: 2021/8/7 18:03
 */
public class BusinessException extends RuntimeException{

    private BusinessExceptionCode code;

    public BusinessException (BusinessExceptionCode code) {
        super(code.getDesc());
        this.code = code;
    }

    public BusinessExceptionCode getCode() {
        return code;
    }

    public void setCode(BusinessExceptionCode code) {
        this.code = code;
    }

    /**
     * 不写入堆栈信息，提高性能
     */
    @Override
    public Throwable fillInStackTrace() {
        return this;
    }
}